// Class to store anything and can have a capacity.

if(!$defined(meio)) var meio = {};

meio.Cache = new Class({
					  
	Implements: Options,
	
	options: {
		capacity: 10
	},
	
	initialize: function(options){
		this.setOptions(options);
		this.keys = new Array();
		this.values = new Array();
	},
	
	store: function(key, value){
		this.keys.push(key);
		this.values.push(value);
		if(this.options.capacity != 0 && this.keys.length >= this.options.capacity){
			this.keys.shift();
			this.values.shift();
		}
	},
	
	get: function(key){
		return this.values[this.keys.indexOf(key)];
	},
	
	hasKey: function(key){
		return this.keys.contains(key);
	}
	
});